/*
 *===========================================================================
 *
 *          Name: jkfunc.c
 *        Create: Thu 09 Aug 2012 11:32:25 AM CST
 *
 *   Discription: 
 *       Version: 1.0.0
 *
 *         Email: jmdkina@gmail.com
 *
 *===========================================================================
 */

#include <stdio.h>
#include <string.h>
#include <strings.h>

#include "jkfunc.h"

int jk_parse_string_counts(char *string, unsigned char sign)
{
    if (string == NULL) return -1;
    int     counts = 0;
    char    tmp[MAX_STRING_PARSE];
    bzero(tmp, sizeof(tmp));
    strcpy(tmp, string);
    
    char   *p = tmp;
    while(*p != '\0') {
        if (*p == sign) counts++;
        p++;
    }

    return counts+1;
}


/*=============== End of file: jkfunc.c ==========================*/

